package com.haima.sage.bigdata.api.entity.api.data.config;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.haima.sage.bigdata.api.frame.filter.Filter;
import com.haima.sage.bigdata.api.entity.api.data.cases.ConfigType;

import java.util.List;

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME,
        include = JsonTypeInfo.As.EXISTING_PROPERTY,
        property = "type",
        defaultImpl = DbApiConfig.class,
        visible = true)
@JsonSubTypes({
        @JsonSubTypes.Type(value = DbApiConfig.class, name = "db"),
        @JsonSubTypes.Type(value = EsApiConfig.class, name = "es"),
        @JsonSubTypes.Type(value = RedisApiConfig.class, name = "redis")})
public class ApiConfig {
    protected ConfigType type;
    protected String data;
    protected String storage;
    protected List<Filter> filters;

    public List<Filter> getFilters() {
        return filters;
    }

    public void setFilters(List<Filter> filters) {
        this.filters = filters;
    }

    public String getStorage() {
        return storage;
    }

    public void setStorage(String storage) {
        this.storage = storage;
    }

    public ConfigType getType() {
        return type;
    }

    public void setType(ConfigType type) {
        this.type = type;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }
}
